<?php
/**
* @package Scribble
*/
use Buan\Config;
use Buan\UrlCommand;
$urlRoot = Config::get('ext.Scribble.urlRoot');

ScribbleAdminView::getGlobalView()->addJavascripts("{$urlRoot}/js/scribble/site/edit.js");
?>

<div class="head">
	<h1>Sites</h1>
	<h2>Edit Site</h2>
</div>

<?php if(($cSite=SiteManager::getCurrentSite())!==NULL && $cSite->id===$site->id): ?>
<p class="information">
	You are logged into this site right now, so please be careful about what you change here otherwise you could be left without access.
</p>
<?php endif; ?>

<form method="post" action="<?php $this->html->eUrl(UrlCommand::createUrl('scribble', 'site', $site->id)); ?>" enctype="multipart/form-data">
	<input type="hidden" name="submit" value="1" />

	<div class="std-tabbed">
		<div class="std">
			<h3><u>P</u>rivileges</h3>

			<input rel="scribble-widget" scribblewidget:type="privilege-editor" scribblewidget:config="resourceId=<?php echo $site->isInDatabase() ? $site->id : ''; ?>" type="hidden" name="privileges" value="<?php $this->html->e($privilegeData); ?>" />
		</div>
	</div>

	<p>
		<button class="submit" type="submit" value="Save">Save</button>
		<button class="delete" type="submit" name="method" value="Delete" rel="site-delete" disabled="disabled">Delete</button>
	</p>
</form>